home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / answrbok / 7_7.lha / 7_7 / 7_7insert.c < prev    next >
Text File  |  1993-08-08  |  415b  |  18 lines

  1. * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
  2. * The C++ Answer Book */
  3. * Tony Hansen */
  4. * All rights reserved. */
  5. / insert an entry at the beginning of the list
  6. oid dlist_iterator::insert(ent a)
  7.  
  8.    if (curr_dlist->last)
  9. curr_dlist->last->next->insert(new dlink(a));
  10.  
  11.    else
  12. {
  13. curr_dlist->last = new dlink(a);
  14. curr_dlist->last->next =
  15.     curr_dlist->last->prev = curr_dlist->last;
  16. }
  17.  
  18.